DEFINITION FOR AMIGALIB MODULE Audio ;

FROM SYSTEM IMPORT ADDRESS ;
FROM Exec   IMPORT CMD_NONSTD, Message, IORequest ;

CONST
  AUDIONAME = "audio.device" ;

  ADHARD_CHANNELS = 4 ;

  ADALLOC_MINPREC = -128 ;
  ADALLOC_MAXPREC =  127 ;

  ADCMD_FREE	  = CMD_NONSTD+0 ;
  ADCMD_SETPREC	  = CMD_NONSTD+1 ;
  ADCMD_FINISH	  = CMD_NONSTD+2 ;
  ADCMD_PERVOL	  = CMD_NONSTD+3 ;
  ADCMD_LOCK	  = CMD_NONSTD+4 ;
  ADCMD_WAITCYCLE = CMD_NONSTD+5 ;
  ADCMD_ALLOCATE  = 32 ;

  ADIOB_PERVOL	      = 4 ; ADIOF_PERVOL       = { ADIOB_PERVOL }	;
  ADIOB_SYNCCYCLE     = 5 ; ADIOF_SYNCCYCLE    = { ADIOB_SYNCCYCLE  }	;
  ADIOB_NOWAIT	      = 6 ; ADIOF_NOWAIT       = { ADIOB_NOWAIT }	;
  ADIOB_WRITEMESSAGE  = 7 ; ADIOF_WRITEMESSAGE = { ADIOB_WRITEMESSAGE } ;

  ADIOERR_NOALLOCATION	= -10 ;
  ADIOERR_ALLOCFAILED	= -11 ;
  ADIOERR_CHANNELSTOLEN	= -12 ;

TYPE
  IOAudio = RECORD
    ioa_Request  : IORequest;
    ioa_AllocKey : INTEGER  ;
    ioa_Data     : ADDRESS  ;
    ioa_Length   : LONGINT  ;
    ioa_Period   : CARDINAL ;
    ioa_Volume   : CARDINAL ;
    ioa_Cycles   : CARDINAL ;
    ioa_WriteMsg : Message  ;
  END ;

END Audio.
